package com.hjy;

import java.util.function.Supplier;

public class MySupplierDemo {
    public static Integer getMin(Supplier<Integer> supplier){
        return supplier.get();
    }

    public static void main(String[] args) {
        int[] arr = {111,222,444,1111,-98, 999};
        Integer res = getMin(() -> {
            int min = arr[0];
            for (int i : arr) {
                if(i < min){
                    min = i;
                }
            }
            return min;
        });
        System.out.println(res);

    }
}
